
#pragma once

#include "technique.h"
#include "ublocks.h"

namespace EggNine {

class PresentTechnique : public IProgram {
protected:
    GLint   m_viewportX, m_viewportY;
    GLsizei m_viewportWidth, m_viewportHeight;

    PresentTechnique(const string& name, const string& alias);

    void ResetStateToProgram() const;
    void GetActiveUniforms(const UniformMap& uBlocks);

public:

    PresentTechnique(const string& shaderName);
    ~PresentTechnique();

    void DrawPass(int pass=0) const;
    void SetDiffuseTexture(GLuint tex) const;

    virtual void SetViewport(GLint x, GLint y, GLsizei width, GLsizei height);
};

class DisplacedQuadTechnique : public PresentTechnique {
private:
    GLuint  m_material;

protected:
    void GetActiveUniforms(const UniformMap& uBlocks);

public:
    DisplacedQuadTechnique(const string& shaderName);
    ~DisplacedQuadTechnique();

    void SetDispTexture(GLuint tex) const;
};

} // EggNine
